<%--
  Created by IntelliJ IDEA.
  User: zhanzhongxin
  Date: 2021/8/6
  Time: 9:47
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
</head>
<body>
<%
    Cookie cookie1 = new Cookie("name", "zhangsan");
    cookie1.setMaxAge(10);//单位：秒
    Cookie cookie2 = new Cookie("name", "lisi");
    response.addCookie(cookie1);
    response.addCookie(cookie2);

%>
</body>
</html>
